package cn.ghjcloud.marking.admin.controller;

import cn.ghjcloud.marking.commons.exception.MyException;
import cn.ghjcloud.marking.commons.model.Result;
import cn.ghjcloud.marking.commons.model.ResultCode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
	
	@GetMapping(value="/{id}")
	public Result foo(@PathVariable Integer id){
		if(id==1){
			throw new MyException(ResultCode.DATA_IS_NULL);
		}
		return new Result(ResultCode.SUCCESS);
	} 
}
